package com.freecloud.framework.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.multipart.commons.CommonsMultipartResolver;

/**
 * @Author: maomao
 * @Date: 2019-08-18 18:35
 */
@Configuration
public class UploadConfig {

    /**
     * 50MB
     */
    private long MaxUploadSize = 50 * 1024 * 1024;

    @Bean("multipartResolver")
    public CommonsMultipartResolver getMultipartResolver(){
        CommonsMultipartResolver resolver = new CommonsMultipartResolver();
        resolver.setMaxUploadSize(MaxUploadSize);
        return resolver;
    }
}
